<?php
global $VALUTA, $USER_SETTING;
?>
<h2><?=lang('Операции с мавро по платежу')?></h2>

<table class='list operations' cellspacing=0 style="width:auto;">
	<thead>
		<tr>
			<th><?=lang('Участник')?></th>
			<th><?=lang('Дата')?></th>
			<th><?=lang('Сумма')?></th>
			<th><?=lang('Курс')?></th>
			<th><?=lang('Мавро')?></th>
			<th><?=lang('Срок разморозки')?></th>
			<th><?=lang('Сумма при разморозке')?></th>
			<th><?=lang('Вид и место хранения')?></th>
			<th><?=lang('Дополнительно')?></th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($opers as $o) {
			$type_class = isBuy($o) ? 'buy' : 'sell';
			$super = $o['depo'] && substr($o['percent'], -1) == 5 ? "super" : '';
			$frozen_gray = $o['frozen_date'] && $o['frozen_date'] < date('Y-m-d') ? 'gray' : '';
			$show_frozen = $o['frozen_summ'] && $o['frozen_date'];
			?>
			<tr>
				<td style='text-align:left'><?php echo @$o['user']['fio']." (".@$o['user']['email'].")"?></td>
				<td class='<?=($o['bonus']) ? 'bonus' : ''?> o_date'><?=$o['day']?>.<?=$o['month']?>.<?=$o['year']?></td>
				<td class='<?=($o['bonus']) ? 'bonus' : ''?> <?=$type_class?> o_summ'><?=$o['summ']?> <?=$VALUTA[$o['valuta']]?></td>
				<td class='<?=($o['bonus']) ? 'bonus' : ''?> <?=$type_class?> o_kurs'>
					<?php if($o['type'] == 'week') {?>
						<?=$o['percent']?>%
					<?php } else { ?>
						<?php if($o['kurs_valuta'] > 0 && $o['kurs_valuta'] != 1) echo $o['kurs_valuta']." / "; ?>
						<?=$o['valuta']?> <?=$o['kurs']?> <?=$VALUTA[$o['mavro_valuta']]?> (<?=$o['percent']?>%)
					<?php }?>
				</td>
				<td class='<?=($o['bonus']) ? 'bonus' : ''?> <?=$type_class?> o_mavro'>
					<?php if($o['type'] != 'week') {?>
						<?=$o['mavro']?> <?=$o['mavro_valuta']?> <?php if($o['depo']) echo "(".$o['depo']."m ".$super.")";?>
					<?php } ?>
				</td>
				<td class='<?=($is_bonus ? 'bonus' : '').' '.$frozen_gray?>'><?=$show_frozen ? getPrintDate($o['frozen_date']) : ''?></td>
				<td class='<?=($is_bonus ? 'bonus' : '').' '.$frozen_gray?>'><?=$show_frozen ? (number_format($o['frozen_summ'], 2, $USER_SETTING['znak_drob'], ' ')).' '.$VALUTA[$o['mavro_valuta']] : ''?></td>
				<td class='<?=($o['bonus']) ? 'bonus' : ''?> o_hranen'><?=$o['hranen']?></td>
				<td class='o_dop'><?=$o['dop']?></td>
			</tr>
		<?php } ?>
	</tbody>
</table>


